<template>
  <div>
    <van-swipe class="my-swipe" :autoplay="5000" indicator-color="white" :style="{height:h}">
      <van-swipe-item><img src="image/swipe/1.png" alt=""></van-swipe-item>
      <van-swipe-item><img src="image/swipe/2.png" alt=""></van-swipe-item>
      <van-swipe-item><img src="image/swipe/3.png" alt=""></van-swipe-item>
    </van-swipe>
  </div>
</template>
<style scoped>
img{
    width:100%
}
</style>
<script>
export default {
    data(){
        return {
            h:'0px'
        }
    },
    // 动态生成图片的高
    mounted(){
        // 值需要改变
        let picw = 3796;
        // 值需要改变
        let pich = 1520;
        let imgw = window.screen.width; // 屏幕宽度
        let imgh = ((imgw*pich)/pich)+'px';
        this.h = imgh;
    }
}
</script>